package com.self.auth.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.security.Principal;

/**
 * @version v1.0
 * @ClassName: UserInfoController
 * @Description:
 * @Author: Mac
 * @Date: 2022/5/28 10:22
 */
@RestController
public class UserInfoController {

    /**
     * @Title: 获取用户信息
     * @Description:
     * @Param [principal]
     * @Return java.security.Principal
     * @Author Mac
     * @Throws
     * @Date 2022/5/28 10:24
     */
    @GetMapping("/user/info")
    public Principal userInfo(Principal principal){
        //principal auth2.0自动注入的
        return principal;
    }
}
